<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <title>闭包测试</title>

    <script>

        var g = "ggg"
        function f1() {
            var a = "aaa";
            var a2 = "a22";
            {
                let l = "lll"
                let l2 = "l22"
                return function f2() {
                    var b = "bbb";
                    console.log(g);
                    console.log(a);
                    console.log(b);
                    console.log(l);
                }
            }
        }

        var fun = f1()
        fun();




    </script>
</head>

<body>

</body>

</html>